<?php

namespace App\Http\Requests\Api;

use App\Models\User;
use Dingo\Api\Http\FormRequest;

class UserDataRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    public function rules()
    {
        if ($this->isMethod('PUT')) {

            $rules = [
                'email' => [
                    'email',
                    'unique:users,email',
                ],
                'password' => [
                    'min:6',
                    'max:33',
                ],
                'password_confirm' => [
                    'same:password',
                ],
                'role' => [
                    'in:customer,seller',
                ],
                'nick_name' => [

                ],
                'avatar' => [

                ],

                'age' => [
                    'integer',
                ],
                'stature' => [
                    'numeric',
                ],
                'weight' => [
                    'numeric',
                ],
                'bust' => [
                    'numeric',
                ],
                'waist' => [
                    'numeric',
                ],
                'hips' => [
                    'numeric',
                ],
                'video' => [

                ],
                'intro' => [
                    'size:150',
                ],
            ];


            return $rules;
        }
    }

}
